package com.gg.star.controller;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;

import com.gg.star.service.StarService;

import base.BaseServlet;


@WebServlet("/star/ChangeScountBySidServlet")
public class ChangeScountBySidServlet extends BaseServlet {
	@Autowired
	private   StarService  starService;
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String   sid =  request.getParameter("sid");
		Integer  count   = Integer.parseInt(request.getParameter("count"));
		
		boolean   res =  starService.changeScountBySid(sid,count);
		//如果不设置这个 头 ，  前端获取的是   "true"  ,  "false"
		response.setContentType("json/application;charset=utf-8");
		
		response.getWriter().print(res);
		
	}

}
